using SimpleFramework;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace Game
{
    public class SceneManager: TSingleton<SceneManager>, ITimer
    {
        private SceneBase[] m_Scenes = new SceneBase[10];
        private SceneBase m_Current;

        public SceneManager()
        {
            m_Scenes[0] = new HotupScene();
            m_Scenes[1] = new LaunchScene();
            m_Scenes[2] = new HomeScene();
            TimerSystem.Instance.Add(this);
        }

        public void Change(SceneId id)
        {
            if (m_Current != null)
                m_Current.OnExit();
            m_Current = m_Scenes[(int)id];
            m_Current.OnEnter();
        }

        public bool Update()
        {
            if (m_Current != null)
                m_Current.OnUpdate();
            return false;
        }
    }
}